dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/fold.c)
AC_CONFIG_HEADER(config.h)
AC_PREREQ(2.10)dnl               dnl Minimum Autoconf version required.
AC_ARG_PROGRAM

PACKAGE=textutils
VERSION=1.19
PACKAGE_VERSION="GNU $PACKAGE-$VERSION"
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_DEFINE_UNQUOTED(PACKAGE_VERSION, "$PACKAGE_VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE_VERSION)

jm_MAINTAINER_MODE

ALL_LINGUAS="de fr ko nl"

changequote(,)dnl
case $VERSION in
  *[a-z]) README_ALPHA=README-alpha;;
  *) README_ALPHA=;;
esac
changequote([, ])dnl
AC_SUBST(README_ALPHA)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
AC_PROG_RANLIB
AC_AIX
AC_MINIX
AC_ISC_POSIX

ud_WITH_REGEX

dnl Checks for header files.
AC_CHECK_HEADERS(limits.h string.h memory.h fcntl.h float.h unistd.h values.h)
AC_HEADER_STAT
AC_HEADER_STDC

dnl This test must precede tests of compiler characteristics like
dnl that for the inline keyword, since it may change the degree to
dnl which the compiler supports such features.
fp_C_PROTOTYPES

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_BIGENDIAN
AC_C_CONST
AC_C_INLINE
AC_C_LONG_DOUBLE

AC_HEADER_DIRENT
AC_STRUCT_ST_BLKSIZE
AC_TYPE_OFF_T
AC_TYPE_SIGNAL
AC_TYPE_SIZE_T

dnl Checks for library functions.
AC_CHECK_FUNCS(getdelim strerror isascii strchr strrchr)
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AM_FUNC_STRTOD
AC_REPLACE_FUNCS(memcpy memmove memset stpcpy strtoul)
AC_REPLACE_GNU_GETOPT

ud_GNU_GETTEXT
AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)

AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile \
man/Makefile po/Makefile.in src/Makefile], [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
